{extend name="base" /}
{block name="body"}
<div class="layui-card">
    <div class="layui-card-header">
        <form action="{:url('admin/course/courseOrder')}" class="layui-form" method="get">
            <div class="layui-form-item">
                <div class="layui-input-inline">
                    <input type="text" name="orderid" value="{:input('orderid')}" autocomplete="off" placeholder="请输入订单号" class="layui-input"/>
                </div>
                <div class="layui-input-inline">
                    <select name="state">
                        <option value="">全部订单</option>
                        <option value="1" {if condition="input('?state') and  input('state') eq 1" }selected="selected"{/if}>支付订单</option>
                        <option value="0" {if condition="input('?state') and  input('state') eq 0" }selected="selected"{/if}>未付订单</option>
                    </select>
                </div>
                <div>
                    <button class="layui-btn layui-btn-primary ajax-search"><i class="fa fa-search"></i></button>
                </div>
            </div>
        </form>
    </div>
    <div class="layui-card-body">
        <div class="layui-btn-group">
            <a href="{:url('admin/course/delCourseOrder')}" class="layui-btn layui-btn-danger ajax-batch"><i class="fa fa-trash-o"></i> 批量删除</a>
            <a href="{:url('admin/course/exportorder')}" class="layui-btn ajax-iframe" data-width="600px" data-height="400px"><i class="fa fa-trash-o"></i> 导出订单</a>
        </div>
        <table class="layui-table layui-form">
            <thead>
            <tr>
                <th style="width:20px;"><input type="checkbox" lay-skin="primary" lay-filter="*"></th>
                <th >订单号</th>
                <th  style="width:70px;">用户名</th>
                <th  style="width:57px;">支付方式</th>
                <th  style="width:57px;">状态</th>
                <th  style="width:50px;">总价</th>
                <th  style="width:57px;">教师分成</th>
                <th  style="width:130px;">创建时间</th>
                <th  style="width:140px;">订单课程</th>
                <th  style="width:30px;">操作</th>
            </tr>
            </thead>
            <tbody>
            {foreach name="list" item="v" empty="$empty"}
            <tr>
                <td><input type="checkbox" name="id" value="{$v.id}" lay-skin="primary"></td>
                <td>{$v.orderid}</td>
                <td>{$v.uid|getUserName}</td>
                <td>{$v.paytype|getPayMethod}</td>
                <td>{$v.state|getOrderSatatus}</td>
                <td>{$v.total} 元</td>
                <td>{$v.profit} 元</td>
                <td>{$v.addtime}</td>
                <td>{$v.cid|getCourseName=###,$v.ctype}</td>
                <td>
                    <div class="layui-btn-group mb0">
                        <a href="{:url('admin/course/delCourseOrder', ['id' => $v.id])}" class="layui-btn layui-btn-xs layui-btn-danger ajax-delete">
                            <i class="layui-icon">&#xe640;</i></a>
                    </div>
                </td>
            </tr>
            {/foreach}
            </tbody>
        </table>
        <div class="page">{$list->render()}</div>
    </div>
</div>
{/block}